package pbx.job.process;

import javax.ejb.ConcurrentAccessTimeoutException;
import javax.ejb.EJB;
import javax.ejb.Lock;
import javax.ejb.LockType;
import javax.ejb.Schedule;
import javax.ejb.Singleton;
import javax.ejb.Startup;


@Startup
@Singleton
public class QueueLogJob {
	
	@EJB
    private QueueLogWorker queuelogWorker;
	
	
	@Lock(LockType.READ)
	//@Schedule(second = "*/1", minute = "*", hour = "*", persistent = false)
	public void ProcessQueueLogs() {
		try {
			//System.out.println("STARTING QUEUELOG WORKER");
			queuelogWorker.processQueueLogs();
			//System.out.println("FINISHING QUEUELOG PROCESS");
        }
		catch (InterruptedException e) {
            //System.out.println("PROCESS QUEUELOG IS BUSY - InterruptedException");
        }
		catch (ConcurrentAccessTimeoutException e) {
           //System.out.println("PROCESS QUEUELOG IS BUSY - ConcurrentAccessTimeoutException");
        }
		
	}


}